﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace InstrumentationLibrary.Config
{
    public enum InstrumentationTypes { Duration, CallCount, ExceptionCount };

    public class InstrumentationConfig
    {
        public string AssemblyFullName { get; set; }
        public string TypeFullName { get; set; }
        public string MethodName { get; set; }
        public List<string> ParameterList { get; set; }
        public InstrumentationTypes InstrumentationType { get; set; }

        public void Validate()
        {
            if (string.IsNullOrWhiteSpace(AssemblyFullName))
            {
                throw new InvalidOperationException("Assembly name is required");
            }

            if (string.IsNullOrWhiteSpace(TypeFullName))
            {
                throw new InvalidOperationException("Type name is required");
            }

            if (string.IsNullOrWhiteSpace(MethodName))
            {
                throw new InvalidOperationException("Method name is required");
            }

            if (ParameterList == null)
            {
                ParameterList = new List<string>();
            }
        }
    }
}
